package com.qingzhuge.member.entity;

import com.qingzhuge.entity.BasePkLongEntity;
import com.qingzhuge.member.enums.EnumThirdAppType;
import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.persistence.Entity;
import javax.persistence.Table;
import javax.validation.constraints.NotBlank;

/**
 * @author : zero.xiao
 * @description : 第三方配置
 * @date :2018/10/15 0015 下午 20:43
 * @modified :
 * @since : 1.0.0
 */
@EqualsAndHashCode(callSuper = true)
@Data
@Entity
@Table(name = "sys_config_third_app")
public class SysThirdAppConfig extends BasePkLongEntity {
    private static final long serialVersionUID = -8908807666192077612L;
    /**
     * 系统配置信息-微信公众号配置
     */
    public final static String SYS_THIRD_WX_CONFIG_KEY = "SYS_THIRD_WX_CONFIG_KEY";
    /**
     * 系统配置信息-微信小程序配置
     */
    public final static String SYS_THIRD_WX_APP_CONFIG_KEY = "SYS_THIRD_WX_APP_CONFIG_KEY";
    /**
     * 系统配置信息-支付宝配置
     */
    public final static String SYS_THIRD_ALIPAY_CONFIG_KEY = "SYS_THIRD_ALIPAY_CONFIG_KEY";
    /**
     * 系统配置信息-支付宝小程序配置
     */
    public final static String SYS_THIRD_ALIPAY_APP_CONFIG_KEY = "SYS_THIRD_ALIPAY_APP_CONFIG_KEY";
    /**
     * 类型,微信小程序\支付宝小程序\百度小程序\小应用
     */
    private EnumThirdAppType type;
    /**
     * 设置AppID
     */
    @NotBlank(message = "开发者ID(AppID)不能为空")
    private String appId;

    /**
     * 设置AppSecret
     */
    @NotBlank(message = "开发者密钥(AppSecret)不能为空")
    private String appSecret;
    /**服务器地址(URL*/
    private String url;
    /**回调地址*/
    private String redirectUrl;
    /**
     * 设置消息服务器配置的token
     */
    private String token;

    /**
     * 设置消息服务器配置的EncodingAESKey
     */
    private String encodingAESKey;

    /**
     * 消息格式，XML或者JSON
     */
    private String msgDataFormat;

    public SysThirdAppConfig() {
    }

    public SysThirdAppConfig(Long id) {
        super(id);
    }

    public SysThirdAppConfig(EnumThirdAppType type) {
        this.type = type;
    }
}